package com.web.service.impl;

import com.web.dao.StudentDao;
import com.web.entity.Student;
import com.web.service.StudentService;

import java.util.List;

public class StudentServiceImpl implements StudentService {

    private StudentDao studentDao = new StudentDaoImpl();
    @Override
    public List<Student> findStudentAll() {
        return studentDao.selectStudentAll();
    }

    @Override
    public List<Student> findStudentByName(String name) {
        return studentDao.selectStudentByName(name);
    }

    @Override
    public List<Student> findStudentById(int id) {
        return studentDao.selectStudentById(id);
    }

    @Override
    public boolean addStudent(Student student) {
        return studentDao.insertStudent(student);
    }

    @Override
    public boolean updateStudent(Student student) {
        return studentDao.updateStudent(student);
    }

    @Override
    public boolean removeStudentById(int id) {
        return studentDao.deleteStudentById(id);
    }
}
